// localStorage相关
export function setLocalStorage(name, data) {
  localStorage.setItem(name, JSON.stringify(data))
}

export function getLocalStorage(name) {
  return JSON.parse(localStorage.getItem(name))
}

export function removeLocalStorage(name) {
  localStorage.removeItem(name)
}

// sessionStorage相关
export function setSessionStorage(name, data) {
  sessionStorage.setItem(name, JSON.stringify(data))
}

export function getSessionStorage(name) {
  return JSON.parse(sessionStorage.getItem(name))
}

export function removeSessionStorage(name) {
  sessionStorage.removeItem(name)
}
